<template>
  <div>
    <p>Field A: {{ fieldA }}</p>
    <p>Field B: {{ fieldB }}</p>
    <button @click="updateField">Switch Fields</button>
  </div>
</template>

<script>
export default {
  computed: {
    // 直接从 store 中获取状态
    fieldA() {
      return this.$store.state.yourModule.fieldA;
    },
    fieldB() {
      return this.$store.state.yourModule.fieldB;
    },
  },
  methods: {
    // 提交 mutation
    updateField() {
      this.$store.commit('yourModule/updateField');
    },
  },
};
</script>